<?php

// $Id: ci_attachment_edit_wp.class.php 1570 2009-01-13 12:44:02Z ogrebg $


require_once($WSC->get_site_inc_dir().'modules/tangra_cms/_sys/tcms_admin_page_w_fctrl_ua.class.php');
require_once($WSC->get_site_inc_dir().'modules/tangra_cms/forms/_ci/ci_attachment/ci_attachment_form_ctrl.class.php');


class CI_Attachment_Edit_WP extends TCMS_Admin_Page_W_FCtrl_UA {
	public function create_view($name = 'default') {
		$ret = new TCMS_Admin_Page_View($this, $name, 'modules/tangra_cms/pages/_ci/');

		return $ret;
	}


	protected function init_transit_vars() {
		$this->add_transit_var('vpage');
		$this->add_transit_var('category');
		$this->add_transit_var('ret');
		$this->add_transit_var('ci');
	}


	protected function create_form_ctrl() {
		$dbc = $this->get_dbc();
		$tvm = $this->get_tvm();

		$ret = new CI_Attachment_Form_Ctrl('ci_attachment', $tvm, $dbc, 'obj_id');

		return $ret;
	}


	protected function on_add_new() {
		throw new Tangra_Module_Exception('Not permited');
	}


	protected function on_received_id($object_id) {

	}


	protected function create_default_redir_view() {
		$object = $this->form_ctrl->get_object();

		$redir_view = $this->create_redirect_view($this->get_redir_on_success(), array('ci' => $this->get_transit_var('ci')));

		return $redir_view;
	}
}